package com.liu.webstore.repository;

import com.liu.webstore.entity.Comment;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author LiuYumei
 * @Date 2022/7/25 22:04
 */
@Mapper
public interface CommentMapper {
    List<Comment> selectCommentsByEntity(
            @Param("entityType") int entityType,
            @Param("entityId") int entityId,
            @Param("offset") int offset,
            @Param("limit") int limit
    );

    int selectCountByEntity(
            @Param("entityType") int entityType,
            @Param("entityId") int entityId
    );

    int insertComment(Comment comment);

    Comment selectCommentById(@Param("id") int id);
}
